package com.first.service.impl;

import com.first.dao.BTypeDao;
import com.first.dao.BookDao;
import com.first.entity.BType;
import com.first.entity.Book;
import com.first.entity.Type;
import com.first.service.BookService;

import org.springframework.stereotype.Repository;

import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Repository
@Service
public class BookServiceImpl implements BookService {
    @Resource
    private BookDao bookDao;
    @Resource
    private BTypeDao bTypeDao;

    @Override
    public int addType(BType type) {
        return bookDao.addType(type);
    }

    @Override
    public List<Map> queryBookByTypeid(Book book) {
        return bookDao.queryBookByTypeid(book);
    }

    @Override
    public List<Map> queryBooks(Book book) {
        return bookDao.queryBooks(book);
    }

    @Override
    public List<Map> queryAllBookType(Book book) {
        return bookDao.queryAllBookType(book);
    }




    @Override
    public int getBookCount(Book book) {
        return bookDao.getBookCount(book);
    }

    @Override
    public int addBook(Book book) {
        return bookDao.addBook(book);
    }

    @Override
    public int updateBookById(Book book) {
        return bookDao.updateBookById(book);
    }

    @Override
    public int delBookById(Integer id) {
        return bookDao.delBookById(id);
    }

    @Override
    public List<Map> getBookType() {
        return bTypeDao.getBookType();
    }

    @Override
    public int addBookType(BType bType) {
        return bTypeDao.addBookType(bType);
    }

    @Override
    public int updateBookType(BType bType) {
        return bTypeDao.updateBookType(bType);
    }

    @Override
    public int delBookType(Integer bookid) {
        return bTypeDao.delBookType(bookid);
    }
}
